/**	
 * <br>
 * Copyright 2011 Chuan. All rights reserved.<br>
 * <br>			 
 * Package: com.chuan.mantu.utils <br>
 * FileName: FileSorter.java <br>
 * <br>
 * @version
 * @author javacyc@qq.com
 * @created 2012-11-20
 * @last Modified 
 * @history
 */

package com.chuan.mantu.utils;

import java.io.File;
import java.util.Comparator;

/**
 * {文件排序<br>
 *  1)根据文件ID倒序<br>
 *  }
 *  
 *  @author javacyc@qq.com
 *  @created 2012-11-20 下午01:04:58
 *  @lastModified       
 *  @history           
 */

public class FileSorter implements Comparator<File> {

	@Override
	public int compare(File object1, File object2) {
		if(FileUtil.getPicId(object1.getName()) > FileUtil.getPicId(object2.getName())){
			return -1;
		}else if(FileUtil.getPicId(object1.getName()) < FileUtil.getPicId(object2.getName())){
			return 1;
		}else{
			return 0;
		}
	}

}




